<?php
// +----------------------------------------------------------------------
// | 07FLYSAAS [基于ThinkPHP5.0开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2025-2035 http://www.07fly.xyz
// +----------------------------------------------------------------------
// | Professional because of focus  Persevering because of happiness
// +----------------------------------------------------------------------
// | Author: 开发人生 <goodkfrs@qq.com>
// +----------------------------------------------------------------------
namespace app\plat\model;

/**
 * 系统公告=》模型
 */
class TenNotify extends PlatBase
{
    // 批量插入,分发到每个帐号下面
    public function addNotifyUserList($notifyId,$userIds=[])
    {
        $userIdArr=is_array($userIds)?$userIds:str2arr($userIds);
        //批量插入
        foreach ($userIdArr as $userId) {
            $user_data[] = [
                'ten_tenant_id' => TEN_TENANT_ID,
                'rece_user_id' => $userId,
                'notify_id' => $notifyId,
                'create_user_id' => TEN_USER_ID,
            ];
        }
        $user_data && $this->modelTenNotifyUser->deleteInfo(['notify_id'=>$notifyId],true);
        $this->modelTenNotifyUser->setList($user_data);
    }
}
